home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / C++ / Direct3D / CustomUI / CustomUI.fx < prev    next >
Encoding:
Text File  |  2004-09-27  |  1.5 KB  |  55 lines

  1. //--------------------------------------------------------------------------------------
  2. // File: CustomUI.fx
  3. //
  4. // The effect file for the CustomUI sample.  
  5. // 
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //--------------------------------------------------------------------------------------
  8.  
  9.  
  10. //--------------------------------------------------------------------------------------
  11. // Global variables
  12. //--------------------------------------------------------------------------------------
  13. float     g_fTime;                    // App's time in seconds
  14. float4x4 g_mWorld;                    // World matrix for object
  15. float4x4 g_mWorldViewProjection;    // World * View * Projection matrix
  16. texture  g_txScene;
  17.  
  18. sampler  g_samScene =
  19. sampler_state
  20. {
  21.     Texture = <g_txScene>;
  22.     MinFilter = Linear;
  23.     MagFilter = Linear;
  24.     MipFilter = Point;
  25. };
  26.  
  27.  
  28. void VertScene( float4 Pos : POSITION,
  29.                 float2 Tex : TEXCOORD0,
  30.                 out float4 oPos : POSITION,
  31.                 out float2 oTex : TEXCOORD0 )
  32. {
  33.     oPos = mul( Pos, g_mWorldViewProjection );
  34.     oTex = Tex;
  35. }
  36.  
  37.  
  38. float4 PixScene( float2 Tex : TEXCOORD0 ) : COLOR0
  39. {
  40.     return tex2D( g_samScene, Tex );
  41. }
  42.  
  43.  
  44. //--------------------------------------------------------------------------------------
  45. // Techniques
  46. //--------------------------------------------------------------------------------------
  47. technique RenderScene
  48. {
  49.     pass P0
  50.     {
  51.         VertexShader = compile vs_1_1 VertScene();
  52.         PixelShader = compile ps_1_1 PixScene();
  53.     }
  54. }
  55.